package cn.richard.demo.drools.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Service;

import cn.richard.demo.drools.entity.DroolsRule;

@Service
public class DroolsRuleService {

	public List<DroolsRule> listAll(){
		List<DroolsRule> list = new ArrayList<>();
		list.add(new DroolsRule(1, "hello规则重载测试", "package hello\r\n" + 
				"\r\n" + 
				"rule \"rule_hello\"\r\n" + 
				"	when\r\n" + 
				"		eval(true)\r\n" + 
				"	then\r\n" + 
				"		System.out.println(\"被触发的规则：\" + drools.getRule().getName());\r\n" + 
				"end"));
		return list;
	}

}
